<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="button" value="新增" id="add">
<input type="button" value="返回" id="add1">
<form action="/bookLibary_war/conditionServlet" method="post">
    姓名：<input name="user_name" placeholder="准确姓名">
    性别：<input name="sex" placeholder="男/女/其他值">
    联系方式：<input name="phon" placeholder="电话/邮箱">
    <input type="submit" value="查询">
</form>
<hr>
<table border="1" cellspacing="0" width="80%">
    <tr>
        <th>序号</th>
        <th>姓名</th>
        <th>性别</th>
        <th>地址</th>
        <th>联系方式</th>
        <th>注册时间</th>
        <th>到期时间</th>
        <th>状态</th>
        <th>操作</th>

        <c:forEach items="${logs}" var="log" varStatus="status">
             <tr align="center">
<%--                <td>${brand.id}</td>--%>
                <td>${status.count}</td>
                <td>${log.user_name}</td>
                <td>${log.sex}</td>
                <td>${log.home}</td>
                <td>${log.phon}</td>
                <td><fmt:formatDate value="${log.head_time}" pattern="yyyy-MM-dd"/></td>
                <td><fmt:formatDate value="${log.end_time}" pattern="yyyy-MM-dd"/></td>
                <td>${log.statusStr}</td>
                <td><a href="/bookLibary_war/selectByIdServlet?id=${log.id}">修改</a>
                    <a href="
" onclick="confirmDel(${log.id})">删除</a></td>
             </tr>
        </c:forEach>
    </tr>
</table>

<script >
    document.getElementById("add").onclick=function () {
        location.href="/bookLibary_war/addLog.jsp";
    }

    function confirmDel(param)
    {
        if(window.confirm("确定删除?")){
            document.location="/bookLibary_war/deleteServlet?id="+param
        }
    }

</script>
<script>
    document.getElementById("add1").onclick=function () {
        location.href="/bookLibary_war/selectServlet";
    }
</script>


</body>
</html>
